#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
struct Mat {
  int r, c;
  vector<vl> f;
  Mat(int r, int c) : r(r), c(c), f(r, vl(c)) {}
  Mat operator*(const Mat &b) {
    Mat m(r, b.c);
    rep(i, 0, m.r) rep(j, 0, m.c) rep(k, 0, c) m.f[i][j] ^= f[i][k] * b.f[k][j];
    return m;
  }
};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  const int BT = 32;
  int n, m, q;
  cin >> n >> m >> q;
  Mat f0(1, n);
  vector<Mat> E(BT, Mat(n, n));
  rep(i, 0, n) cin >> f0.f[0][i];
  for (int i = 0, u, v; i < m; ++i) {
    cin >> u >> v;
    --u, --v;
    E[0].f[u][v] = E[0].f[v][u] = 1;
  }
  rep(i, 1, BT) E[i] = E[i - 1] * E[i - 1];
  Mat f(1, n);
  for (ll a = 0; q; --q) {
    Mat f = f0;
    cin >> a;
    for (int i = 0; (1LL << i) <= a; ++i) {
      if (a & (1LL << i)) f = f * E[i];
    }
    cout << f.f[0][0] << endl;
  }
}
